<?php require 'gauche.tpl.php';?>
	<div id="content">
	    <div>
	    <h2>Stats personnelles</h2>
	    <form method="post">
	    <fieldset class="options">
	       <legend>Chars</legend>
	       <ul class="options">
	           <li>Afficher :</li>
	           <li><input type="radio" name="frm_all" id="frm_all" value="all" checked="checked"/><label for="frm_all">tous</label></li>
	           <li><input type="radio" name="frm_all" id="frm_garage" value="1" <?php if(isset($_POST['frm_all']) === true && $_POST['frm_all'] === '1') {echo 'checked="checked"';}?>/><label for="frm_garage">garage</label></li>
	           <li><input type="radio" name="frm_all" id="frm_reserve" value="0" <?php if(isset($_POST['frm_all']) === true && $_POST['frm_all'] === '0') {echo 'checked="checked"';}?> /><label for="frm_reserve">réserve</label></li>
	       </ul>
	    </fieldset>
	    
	    <fieldset class="options">
	       <legend>Tiers</legend>
	       <ul class="options">
	       <?php for ($i = 1; $i <= 10; $i++) { 
	           $checked = '';
	           if (isset($_POST['tiers']) === true && (in_array($i, $_POST['tiers']) === true)) {
                    $checked = 'checked="checked"';
                }?>
	           <li><input type="checkbox" value="<?php echo $i?>" name="tiers[]" <?php echo $checked ?> /><?php echo $i?></li>
	        <?php }?>
	       </ul>
	    </fieldset>
	    <input class="options" type="submit" name= "frm_action" value="Appliquer les filtres"/>
	    <input class="options" type="submit" name= "frm_action" value="Reset"/>
	    <input type="hidden" name="frm_col" value="<?php echo $cleTri?>" />
	    <input type="hidden" name="frm_sens" value="<?php echo $sens?>"/>
	    </form>
	    <table class="stats">
	        <tr>
	            <th id="name">tank</th>
	            <th id="battles">battles</th>
	            <th id="wins">wins</th>
	            <th id="winRate">win rate</th>
	            <th id="draws">draws</th>
	            <th id="losses">losses</th>
	            <th id="survived_battles">survécues</th>
	            <th id="spotted">spotted</th>
	            <th id="shots">shots</th>
	            <th id="hits">hits(nb)</th>
	            <th id="hits_percents">hits(%)</th>
	            <th id="frags">frags</th>
	            <th id="xp">xp</th>
	            <th id="battle_avg_xp">xp moy</th>
	            <th id="damage_dealt">damage</th>
	            <th id="damage_received">damage_received</th>
	            <th id="capture_points">cap</th>
	            <th id="dropped_capture_points">def</th>
	            <th id="ER">ER</th>
	            <th id="WN7">WN7</th>
	            <th id="WN8">WN8</th>
            </tr> 
	    <?php foreach ($listeTanks as $tank) {
	        $class = '';
	        if ($tank['in_garage'] === true) {
                $class = 'class="garage"';
            }?>
	        <tr <?php echo $class?>>
	            <td><img class="mastery" src="<?php echo $baseUri?>/images/class-<?php echo $tank['mark_of_mastery']?>.png" /><?php echo $dataTanks[$tank['tank_id']]['name']?></td>
	            <td title="batailles&#10; valeur moyenne :<?php echo $tank['exp']['battles']?>"><?php echo $tank['all']['battles']?></td>
	            <td title="victoires&#10; valeur moyenne :<?php echo $tank['exp']['wins']?>"><?php echo $tank['all']['wins']?></td>
	            <td title="victoires&#10; valeur moyenne :<?php echo $tank['exp']['winRate']?>"><?php echo $tank['all']['winRate']?></td>
	            <td title="nuls"><?php echo $tank['all']['draws']?></td>
	            <td title="perdues&#10; valeur moyenne :<?php echo $tank['exp']['losses']?>"><?php echo $tank['all']['losses']?></td>
	            <td title="survecues"><?php echo $tank['all']['survived_battles']?></td>
	            <td title="spotted&#10; valeur moyenne :<?php echo $tank['exp']['spotted']?>"><?php echo $tank['all']['spotted']?></td>
	            <td title="tirs"><?php echo $tank['all']['shots']?></td>
	            <td title="touchés"><?php echo $tank['all']['hits']?></td>
	            <td title="touchés %"><?php echo $tank['all']['hits_percents']?></td>
	            <td title="frags&#10; valeur moyenne :<?php echo $tank['exp']['frags']?>"><?php echo $tank['all']['frags']?></td>
	            <td title="xp"><?php echo $tank['all']['xp']?></td>
	            <td title="xp moyenne"><?php echo $tank['all']['battle_avg_xp']?></td>
	            <td title="dégats&#10; valeur moyenne :<?php echo $tank['exp']['damage_dealt']?>"><?php echo $tank['all']['damage_dealt']?></td>
	            <td title="dégats subis"><?php echo $tank['all']['damage_received']?></td>
	            <td title="cap"><?php echo $tank['all']['capture_points']?></td>
	            <td title="def&#10; valeur moyenne :<?php echo $tank['exp']['dropped_capture_points']?>"><?php echo $tank['all']['dropped_capture_points']?></td>
	            <td class="<?php echo $tank['ER_status']?>" title="ER"><?php echo $tank['ER']?></td>
	            <td class="<?php echo $tank['WN7_status']?>"  title="WN7"><?php echo $tank['WN7']?></td>
	            <td class="<?php echo $tank['WN8_status']?>"  title="WN8"><?php echo $tank['WN8']?></td>
            </tr> 
	    <?php }?>
	    </table>
	    </div>
    </div>